//
//  HSongRecordCell.m
//  HMusicPlayer
//
//  Created by Hament on 14/9/18.
//  Copyright (c) 2014年 HJ. All rights reserved.
//

#import "HSongRecordCell.h"
#import "HCoreConfig.h"
#import "HskinManager.h"
#import "HSongListView.h"

@implementation HSongRecordCell



-(void)awakeFromNib {


    [self.likeBtn setImage:[HCoreConfig shareConfig].unlikeSongImg];
    [self.likeBtn setAlternateImage:[HCoreConfig shareConfig].likeSongImg];
    [self.likeBtn setAction:@selector(likeSong:)];
    [self.likeBtn setTarget:self];
    
    
    [self.delteBtn setImage:[HCoreConfig shareConfig].delSongNorImg];
    [self.delteBtn setAlternateImage:[HCoreConfig shareConfig].delSongHltImg];
    [self.delteBtn setAction:@selector(deleteSongs:)];
    [self.delteBtn setTarget:self];
}

- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    return self;
}

/*
- (void)drawRect:(NSRect)dirtyRect
{
    [super drawRect:dirtyRect];
    
    // Drawing code here.
    
    CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
    [self.bgcolor setFill];
    CGContextFillRect(context, NSRectToCGRect(dirtyRect));
    
}
*/


-(void)likeSong:(NSButton*)sender{

    if (self.songView) {
        
        [self.songView likeSong:sender];
    }
    
}




-(void)deleteSongs:(NSButton*)sender{

    if (self.songView) {
        
        [self.songView deleteSongs:sender];
    }

}




-(void)refreshBGcolorWithColor:(NSColor*)thecolor{
    self.bgcolor=thecolor;
    //[self clean]
    [self setNeedsDisplay:YES];

}



-(NSColor*)bgcolor{

    if (!_bgcolor) {
        _bgcolor=[HCoreConfig shareConfig].currentSkinManager.leftListGroupCellBGColor;
    }
    return _bgcolor;

}


@end
